using System;
using System.Collections.Generic;
using System.Linq;

namespace Sherwood.Content
{
    ///<summary>
    /// Represents a content record.
    ///</summary>
    public interface IRecord
    {
        /// <summary>
        /// A unique key to globally identify this record.
        /// </summary>
        Guid Id { get; }

        /// <summary>
        /// The identification provided by the <see cref="Client"/>.
        /// </summary>
        string ReferenceId { get; }

        /// <summary>
        /// A culture invariant reference id used to link translations of the same record.
        /// </summary>
        string CultureInvariantReferenceId { get; set; }

        /// <summary>
        /// The source client of this record.
        /// </summary>
        IClient Client { get; }

        /// <summary>
        /// True if content is deleted.
        /// </summary>
        bool IsDeleted { get; }

        /// <summary>
        /// The date the record is created in this system.
        /// </summary>
        DateTime DateCreated { get; }

        /// <summary>
        /// Last modification date of this record. Meta modifications will not affect this property.
        /// </summary>
        DateTime? DateModified { get; set; }
        
        /// <summary>
        /// Last time the record was added to the search index.
        /// </summary>
        DateTime? DateIndexed { get; set; }

        /// <summary>
        /// A title of the content.
        /// </summary>
        string Title { get; set; }

        /// <summary>
        /// A (short) description or summary of the content
        /// </summary>
        string Description { get; set; }

        /// <summary>
        /// A collection of all metas that apply to this record
        /// </summary>
        IQueryable<IMeta> Metas { get; }

        /// <summary>
        /// The .NET culture name of this record.
        /// </summary>
        string CultureName { get; set; }

        /// <summary>
        /// Normally two letter ISO code
        /// </summary>
        string LanguageCode { get; set; }
    }
}